﻿using NuGet;
using OD.ProjectCustomizationTool.Helpers;
using OD.ToolBox.IO;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using OD.ToolBox.Linq;

namespace OD.ProjectCustomizationTool.Tools
{
    internal sealed class EntLibLogging : ProjectUpdaterBase
    {
        protected override void InternalUpdate()
        {
            var package = NuGetHelper.Current.InstallPackage(
                Properties.Resources.EnterpriseLibraryLoggingNuGetPackageId,
                this.CurrentProject,
                this.Monitor.Logger);

            foreach (var item in package.GetAllPackages())
            {
                item.AssemblyReferences.ForEach(x => this.AddReference(item, x));
            }
        }

    }
}
